/**
 * Created by hjqi on 2016/3/27.
 */

angular.module('NatureCloud').factory('composeService', function ($http) {
    return {
        createCompose:function(data){

            return $http.post('/apiCompose/createComp',data).then(function (response) {
                return response;
            });
        },
        getComposeDataAndStatus:function(){

            return $http.post('/apiCompose/getCompAndSt').then(function (response) {
                return response;
            });
        },
        getComposeDetail:function(composeId){
            var data = {
                composeId:composeId
            }
            return $http.post('/opMetaInfo/getWithParam',data).then(function (response) {
                return response;
            });
        },
        getComposeServices:function(composeId){
            var data = {
                composeId:composeId
            }
            return $http.post('/opMetaInfo/getWithParam',data).then(function (response) {
                return response;
            });
        },
        updateCompose:function(data){
            return $http.post('/apiCompose/updateComp',data).then(function (response) {
                return response;
            });
        },
        deleteCompose:function(data){
            return $http.post('/apiCompose/deleteComp',data).then(function (response) {
                return response;
            });
        },
        getComposeMarketList:function(){
            return $http.post('/apiCompose/getCompMarket').then(function (response) {
                return response;
            });
        },
        getComposeMarketItem:function(composeId){
            var data = {
                composeId:composeId
            }
            return $http.post('/apiCompose/getCompMarket',data).then(function (response) {
                return response;
            });
        }
    }
});